﻿using ClumsyWordsPortableLibrary.Shared;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ClumsyWordsPortableLibrary.Model
{
    public class TermDefinition
    {
        public TermDefinition() : this(string.Empty, new List<Group<TermProperties, string>>()) { }

        public TermDefinition(string term, List<Group<TermProperties, string>> tpList)
        {
            this._term = term;
            this._termPropertiesList = tpList;
        }

        /// <summary>
        /// The actual word that is being defined.
        /// </summary>
        private string _term;
        public string Term { get; set; }

        /// <summary>
        /// A collection of all term properties objects.
        /// </summary>
        private List<Group<TermProperties, string>> _termPropertiesList;
        public List<Group<TermProperties, string>> TermPropertiesList { get; set; }

        public bool IsEmpty()
        {
            if (string.IsNullOrEmpty(this.Term)) return true;
            return false;
        }
    }

    public class Group<T, U> : List<T>
    {
        public Group(U key, IEnumerable<T> items)
            : base(items)
        {
            this.Key = key;
        }

        public U Key
        {
            get;
            set;
        }
    }

}
